package it.koutifaris.travianmap.dal.sqlservices;

import it.koutifaris.travianmap.dal.sqlservices.travianserver.TravianServerDbHelper;
import android.test.AndroidTestCase;
import android.test.RenamingDelegatingContext;

public abstract class AbstractServerServiceTest extends AndroidTestCase {

	protected static final String TEST_SERVER = "tsx.travian.com";
	private static final String DELEGATING_CONTEXT_PREFIX = "test";
	private TravianServerDbHelper dbHelper;

	@Override
	protected final void setUp() throws Exception {
		dbHelper = new TravianServerDbHelper(new RenamingDelegatingContext(getContext(), DELEGATING_CONTEXT_PREFIX));
		overridableSetUp();
	}

	protected void overridableSetUp() {
	}

	protected TravianServerDbHelper getDbHelper() {
		return dbHelper;
	}

	protected void setDbHelper(TravianServerDbHelper dbHelper) {
		this.dbHelper = dbHelper;
	}

	@Override
	protected final void tearDown() throws Exception {
		dbHelper.close();
	}

}
